<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@ page import="com.erp.hibernate.beans.Menu"%>
<%@ page import="com.erp.hibernate.beans.Employee"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
		<title>ERP进销存管理系统</title>
		<link href="main.css" rel="stylesheet" type="text/css"/>
		<script language="javascript">
			function showHide(menuname){
				var submenu = menuname;
				if (submenu.style.display == "none"){
					submenu.style.display = "block";
				}else{
					submenu.style.display = "none";
				}
			}
		</script>
	</head>
	<body>
		<table cellpadding="0" cellspacing="0" width="100%" height="90px">
			<tr>
				<td width="3"></td>
				<td background="images/banner.gif">&nbsp;</td>
			</tr>
		</table>
		<table width="100%" cellpadding="0" cellspacing="0">
			<tr>
				<td width="3" rowspan="3"></td>
				<td height="6" colspan="3"></td>
			</tr>
			<tr>
				<td height="3" bgcolor="005991" colspan="3"></td>
			</tr>
			<tr align="center">
				<td valign="top" width="160">
					<table class="leftmenu" cellspacing="4" cellpadding="0" height="500" width="160">
						<tr>
							<td valign="top" align="center">
							    <table>
									<tr>
										<td>
											<table cellspacing="0" cellpadding="0" width="160" align="center">
												<tr>
													<td width="28" height="20"><img height="20" src="images/bg_6_1.gif" width="28"/></td>
													<td align="center" background="images/bg_6_2.gif"><a href="loginout.jsp">注销</a></td>
													<td width="67"><img height="20" src="images/bg_6_3.gif" width="67"/></td>
												</tr>
											</table>
										</td>
									</tr>	
									<tr>
									    <td align="center" background="images/bg_6_2.gif"><%=((Employee)session.getAttribute("employee")).getName() %></td>
									</tr>															    
							        <!--顶级菜单-->
								    <%Menu root =(Menu)session.getAttribute("root");
								      if (root!=null){
								          Object[] childMenus=root.getMenus().toArray();
								      for (int i=0;i<childMenus.length;i++){							      
								           Menu childMenu = (Menu)childMenus[i];						           
								    %>
									<tr>
										<td>
											<table cellspacing="0" cellpadding="0" width="160" align="center">
												<tr>
													<td width="28" height="20"><img height="20" src="images/bg_6_1.gif" width="28"/></td>
													<td align="center" background="images/bg_6_2.gif"><%=childMenu.getName()%></td>
													<td width="67"><img height="20" src="images/bg_6_3.gif" width="67"/></td>
												</tr>
											</table>
										</td>
									</tr>
									<tr>
										<td>
											<table class="leftlist" cellspacing="3" cellpadding="3">
												<!-- 一级菜单 -->
												<%Object[] leafMenus=childMenu.getMenus().toArray();
												  for (int j=0;j<leafMenus.length;j++){
									                   Menu leafMenu=(Menu)leafMenus[j];
									            %>	
												<tr class="list" <%=leafMenu.getUrl().equals("#")?"onclick='javascript:showHide(menu"+leafMenu.getId()+")' style='cursor:hand;'":"" %>>
													<td>
														&nbsp;<img height=7 src="images/arrow.gif" width=11/>&nbsp;<%=leafMenu.getUrl().equals("#")?leafMenu.getName():"<a href='"+leafMenu.getUrl()+"' target='main'>"+leafMenu.getName()+"</a>"%>
													    <%	
													      if (!leafMenu.getMenus().isEmpty()){
													    %>
													     <div id="menu<%=leafMenu.getId()%>" style="display:none">
													        <%Object[] tipMenus=leafMenu.getMenus().toArray();
													          for (int k=0;k<tipMenus.length;k++){ 
													              Menu tipMenu=(Menu)tipMenus[k];
													        %>
															&nbsp;&nbsp;&nbsp;<img src="images/arrow_s.jpg"/>&nbsp;<a href="<%=tipMenu.getUrl()%>" target="main"><%=tipMenu.getName()%></a><br/>
														    <%} %>
														 </div>  
													    <%} %>
													</td>
												</tr>
												<%}%>
											</table>
										</td>
									</tr>										
									<tr>
										<td height=6></td>
									</tr>
									<%}}%>
							    </table>
							</td>
						</tr>
						<tr>
							<td height="90"></td>
						</tr>
					</table>
				</td>
				<td valign="top">
						<TABLE width="100%" class="position" border="0">
						<TR>
							<TD>&nbsp;</TD>
						</TR>
						</TABLE>
						<br>
				</td>
				<td height="480" width="80%" align="center" valign="top">
						<TABLE width="100%" class="position" border="0">
						<TR>
							<TD>&nbsp;</TD>
						</TR>
						</TABLE>
						<br>
					<br/>
					<iframe name="main" frameborder=0 marginwidth=0 marginheight=0 scrolling="auto" width=100% height=100% src="welcome.html"></iframe>
				</td>
			</tr>
		</table>
		<table width="100%" cellpadding="0" cellspacing="0">
			<tr>
				<td></td>
			</tr>
			<tr>
				<td class="copyright" height="36">
					&copy; 2009 深圳职业技术学院, 保留所有权利.
				</td>
			</tr>
		</table>
	</body>
</html>